package com.leonzhangxf.ioc.bean.component;

import com.leonzhangxf.ioc.annotation.Autowired;
import com.leonzhangxf.ioc.annotation.Component;

/**
 * @author leonzhangxf
 */
@Component
public class BeanA implements BeanAInterface {

    private BeanBInterface beanBInterface;

    private BeanB beanB;

    @Override
    public void printA() {
        System.out.println("print A");
        beanBInterface.printB();
        beanB.printB();
    }

    @Autowired
    public void setBeanBInterface(BeanBInterface beanBInterface) {
        this.beanBInterface = beanBInterface;
    }

    @Autowired
    public void setBeanB(BeanB beanB) {
        this.beanB = beanB;
    }
}
